const crypto = require('crypto');
function skipLogin(req,res){
	var userid = req.cookies.userid;
	if(!userid){
		res.redirect('/page/login');
	}
}
function randomValues(arr){
	return  arr[ Math.floor(Math.random() * arr.length) ];
}
function setCrypto(info){
	var secret = '$#%$#%&shjsd$%*&';
	var hash = crypto.createHmac('sha256', secret).update(info).digest('hex');
	return hash;
}
module.exports = {
	skipLogin,
	randomValues,
	setCrypto
};